package cn.lyd.product.domain;

import java.math.BigDecimal;
import java.util.Date;
import cn.lyd.base.domain.BaseDomain;
import cn.lyd.org.domain.Shop;
import cn.lyd.pet.domain.PetType;
import cn.lyd.user.domain.User;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.validation.Valid;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;

/**
 * <p>
 * 
 * </p>
 *
 * @author lyd
 * @since 2023-01-13
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class Product extends BaseDomain{


    /**
     * 服务名称
     */
    @NotBlank
    private String name;
    /**
     * 成本价
     */
    @NotNull
    private BigDecimal costprice;
    /**
     * 售价
     */
    @NotNull
    private BigDecimal saleprice;
    /**
     * 存放fastdfs地址，多个资源使用，分割
     */
    @NotBlank
    private String resources;
    /**
     * 销售数量
     */
    @NotNull
    private Long salecount;
    /**
     * 状态：0下架 1上架
     */
    private Long state;
    /**
     * 下架时间
     */

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm",timezone = "GMT+8")
    private Date offsaletime;
    /**
     * 上架时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm",timezone = "GMT+8")
    private Date onsaletime;
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm",timezone = "GMT+8")
    private Date createtime;



    @NotEmpty
    @Valid
    //列表展示的
    private ProductDetail detail;


    //哪家店铺上传的服务，该店铺的id
    private Shop shop;

    //接收登录人的shopid
    private Long shop_id;


}
